import http from '@/common/http/http'

// 商城搜索框 name
export function shCommodityListSearchApi(data){
	return http({
		url:`/shop/shCommodity/listSearch`,
		isToken : true,
		data,
		method: 'GET'
	})
}

// 展示一级类别
export function shCommodityTypeListTopApi(data){
	return http({
		url:`/shop/shCommodityType/listTop`,
		isToken : true,
		data,
		method: 'GET'
	})
}
//展示二级类别
export function shCommodityTypeListSecondApi(data){
	return http({
		url:`/shop/shCommodityType/listSecond`,
		isToken : true,
		data,
		method: 'GET'
	})
}

// 类别搜索 typeId
export function shCommodityListPageByTypeApi(data){
	return http({
		url:`/shop/shCommodity/listPageByType`,
		isToken : true,
		data,
		method: 'GET'
	})
}

// 查商品详情 commodityId
export function getCommodityDetailApi(data){
	return http({
		url:`/shop/shCommoditySpecification/getCommodityDetail`,
		isToken : true,
		data,
		method: 'GET'
	})
}

// 支付 commodityId
// {"amount":10,"commodityBuys":[{"commoditySpecificationId":"1817777904979521537","num":1}],"openid":"1212121213121"}
export function rechargeApi(data){
	return http({
		url:`/shop/shRecharge/recharge`,
		isToken : true,
		data,
		method: 'POST'
	})
}
//订单查询 
export function orderListApi(data){
	return http({
		url:`/shop/shOrder/list`,
		isToken : true,
		data,
		method: 'GET'
	})
}

//取消订单
export function cancelOrderApi(data){
	return http({
		url:`/shop/shOrder/cancel`,
		isToken : true,
		data,
		method: 'POST'
	})
}
//确认价格
export function confirmCommodityPrice(data){
	return http({
		url:`/shop/shOrder/confirmCommodityPrice`,
		isToken : true,
		data,
		method: 'GET'
	})
}

